import { ref, onMounted } from 'vue'
import { getImageApi } from '@/api/system/user/user'
export default function useImage() {
    let imgSrc = ref('')
    let captchaId = ref('')

    // 获取图片
    const getImage = async () => {
        await getImageApi().then((res) => {
            console.log(res)
            if (res) {
                imgSrc.value = res.data.pic_path
                captchaId.value = res.data.captcha_id
            }
        })
    }
    onMounted(() => {
        getImage()
    })
    return {
        imgSrc,
        captchaId,
        getImage
    }
}
